from captcha.image import ImageCaptcha

img = ImageCaptcha()
ser = img.generate_image('1234')
ser.show()